<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>MockMessageEvent (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">testing.messaging.MockMessageEvent</span>
        <span>Extends</span>
        <span class="fn-name">
          <a href="class_goog_testing_events_Event.html">
          goog.testing.events.Event
</a>
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Creates a new fake MessageEvent.


  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/testing/messaging/mockmessageevent.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td><span class="type"><a href="class_goog_testing_events_Event.html">goog.testing.events.Event</a></span></td><td></td></tr>
  <tr><td>goog.testing.messaging.MockMessageEvent</td><td><span class="type"><a href="class_goog_testing_events_Event.html">goog.testing.events.Event</a></span></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.testing.messaging.MockMessageEvent(<span><span class="arg">data</span>,&nbsp;<span class="arg">opt_origin</span>,&nbsp;<span class="arg">opt_lastEventId</span>,&nbsp;<span class="arg">opt_source</span>,&nbsp;<span class="arg">opt_ports</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">data</span>
        : <span class="type">*</span>
        <div class="entryOverview">The data of the message.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_origin</span>
        : <span class="type">string=</span>
        <div class="entryOverview">The origin of the message, for server-sent and
    cross-document events.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_lastEventId</span>
        : <span class="type">string=</span>
        <div class="entryOverview">The last event ID, for server-sent events.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_source</span>
        : <span class="type">Window=</span>
        <div class="entryOverview">The proxy for the source window, for
    cross-document events.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_ports</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">MessagePort></span>&gt;
        <div class="entryOverview">The Array of ports sent with the
    message, for cross-document and channel events.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_testing_events_Event.html">
              goog.testing.events.Event
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.events.Event.prototype.preventDefault"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">preventDefault<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line105">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.events.Event.prototype.stopPropagation"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">stopPropagation<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line99">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_testing_messaging_MockMessageEvent.html">
              goog.testing.messaging.MockMessageEvent
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.testing.messaging.MockMessageEvent.prototype.constructor"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">constructor</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line43">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.testing.messaging.MockMessageEvent.prototype.data"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">data</span>
        : 
     </div>


     <div class="entryOverview">
       The data of the message.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line52">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.testing.messaging.MockMessageEvent.prototype.lastEventId"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">lastEventId</span>
        : 
     </div>


     <div class="entryOverview">
       The last event ID, for server-sent events.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line64">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.testing.messaging.MockMessageEvent.prototype.origin"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">origin</span>
        : 
     </div>


     <div class="entryOverview">
       The origin of the message, for server-sent and cross-document events.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line58">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.testing.messaging.MockMessageEvent.prototype.ports"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">ports</span>
        : 
     </div>


     <div class="entryOverview">
       The Array of ports sent with the message, for cross-document and channel
events.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line77">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.testing.messaging.MockMessageEvent.prototype.source"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">source</span>
        : 
     </div>


     <div class="entryOverview">
       The proxy for the source window, for cross-document events.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line70">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>

<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_testing_events_Event.html">
              goog.testing.events.Event
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.button"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">button</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line481">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="inputEvent.charCode"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">charCode</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_inputhandler_test.js.source.html#line93">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.ctrlKey"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">ctrlKey</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line483">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.currentTarget"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">currentTarget</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line70">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.defaultPrevented"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">defaultPrevented</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line106">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="inputEvent.keyCode"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">keyCode</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_inputhandler_test.js.source.html#line92">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.propagationStopped_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">propagationStopped_</span>
        : 
     </div>


     <div class="entryOverview">
       Whether to cancel the event in internal capture/bubble processing for IE.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line81">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.relatedTarget"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">relatedTarget</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line344">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.returnValue_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">returnValue_</span>
        : 
     </div>


     <div class="entryOverview">
       Return value for in internal capture/bubble processing for IE.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line95">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.state"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">state</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line545">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="e.target"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">target</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_dom_pagevisibilitymonitor_test.js.source.html#line83">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.testing.events.Event.prototype.type"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">type</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_events_events.js.source.html#line66">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Static Methods</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.messaging.MockMessageEvent.wrap"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.messaging.MockMessageEvent.</span><span class="entryName">wrap<span class="args">(<span class="arg">data</span>,&nbsp;<span class="arg">opt_origin</span>,&nbsp;<span class="arg">opt_lastEventId</span>,&nbsp;<span class="arg">opt_source</span>,&nbsp;<span class="arg">opt_ports</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_events_BrowserEvent.html">goog.events.BrowserEvent</a></span>
      </div>


     <div class="entryOverview">
       Wraps a new fake MessageEvent in a BrowserEvent, like how a real MessageEvent
would be wrapped.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">data</span>
        : <span class="type">*</span>
        <div class="entryOverview">The data of the message.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_origin</span>
        : <span class="type">string=</span>
        <div class="entryOverview">The origin of the message, for server-sent and
    cross-document events.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_lastEventId</span>
        : <span class="type">string=</span>
        <div class="entryOverview">The last event ID, for server-sent events.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_source</span>
        : <span class="type">Window=</span>
        <div class="entryOverview">The proxy for the source window, for
    cross-document events.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_ports</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">MessagePort></span>&gt;
        <div class="entryOverview">The Array of ports sent with the
    message, for cross-document and channel events.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_events_BrowserEvent.html">goog.events.BrowserEvent</a></span>&nbsp;
            The wrapping event.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line97">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



<h2>Static Properties</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.testing.messaging.MockMessageEvent.superClass_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.messaging.MockMessageEvent.</span><span class="entryName">superClass_</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_messaging_mockmessageevent.js.source.html#line43">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package testing.messaging</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="testing.messaging.MockMessageEvent"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
